package com.mindao.app.es.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.mindao.app.common.spring.model.BaseModel;
import com.mindao.app.ea.model.User;

/**
/* 版权所有： 广州敏道科技有限公司
/*
/* 功能描述：
/*
/* 创 建 人：李国才
/* 创建时间：2016年7月15日 下午4:18:42 	
 **/
@Entity
@Table(name = "es_team")
public class EsTeam  extends BaseModel{
	private String name;
	private EsUser leader;//队长
//	private Set<EsUser> users = new HashSet<EsUser>();
//	
//	@ManyToMany //(cascade = CascadeType.ALL, targetEntity = User.class, fetch = FetchType.LAZY)
//	@JoinTable(name = "es_team_user", joinColumns = { @JoinColumn(name = "team_id") }, inverseJoinColumns = { @JoinColumn(name = "user_id") })
//	public Set getUsers() {
//		return users;
//	}
//   
//	public void setUsers(Set<EsUser> users) {
//		this.users = users;
//	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	@ManyToOne 
	@JoinColumn(name = "leader_id", nullable = true)	
	public EsUser getLeader() {
		return leader;
	}

	public void setLeader(EsUser leader) {
		this.leader = leader;
	}
	
}
